package com.atguigu.tingshu.common.thread;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/***
 * 自定义线程池
 */
@Configuration
public class GuiguThreadPoolConfig {
    //自定义线程池
    @Bean
    public ThreadPoolExecutor threadPoolExecutor(){
      return   new ThreadPoolExecutor(4,8,10, TimeUnit.MINUTES,new ArrayBlockingQueue<>(1000));
    }

}
